#pragma once
#ifndef __SCRIPT__EDITOR__VARIABLES__HH__
#define __SCRIPT__EDITOR__VARIABLES__HH__

#include "ScriptEditorPrereqs.h"
#include "ui_ScriptRegisters.h"
#include "LitScriptEngine.h"

namespace Lit
{
	namespace Editor
	{
		class ScriptRegisters : public QDialog
		{
			Ui::ScriptRegistersClass ui;
		public:
			ScriptRegisters( QWidget * parent = NULL );
			~ScriptRegisters();
			
			void setupGlobalVariablesUi();
			void setupGlobalFunctionsUi();
			void setupObjectsUi();
		
			void updateGlobalVariablesUi( const ScriptEnginePtr & engine );
			void updateGlobalFunctionsUi( const ScriptEnginePtr & engine );
			void updateObjectsUi( const ScriptEnginePtr & engine );
			void updateUi( const ScriptEnginePtr & engine );
			int exec( const ScriptEnginePtr & engine );
			
			QTreeWidgetItem * createObjectNode( const std::string &obj_type );
			QTreeWidgetItem * createObjectMethod( QTreeWidgetItem * obj, const std::string & name, const std::string &declaration );
			QTreeWidgetItem * createObjectProperty( QTreeWidgetItem * obj, const std::string & type, const std::string &name );
		};
	};
};

#endif